home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 7_6.lha / 7_6 / tst.c < prev    next >
Text File  |  1993-08-08  |  884b  |  39 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include "7_6a.h"
  6. include "7_6b.h"
  7. include "7_6f.h"
  8.  
  9. include <stream.h>
  10.  
  11. ain()
  12.  
  13.    dlist xdlist("hello");
  14.    xdlist.append("there");
  15.    xdlist.append("how");
  16.    xdlist.append("are");
  17.    xdlist.append("you");
  18.    xdlist.append("today");
  19.    void *x;
  20.    cout << "forwards\n";
  21.    while (xdlist.next(x))
  22. cout << "'" << (char*)x << "'\n";
  23.    cout << "\nbackwards\n";
  24.    while (xdlist.prev(x))
  25. cout << "'" << (char*)x << "'\n";
  26.    xdlist.next(x);
  27.    xdlist.next(x);
  28.    xdlist.inserthere("Beep");
  29.    xdlist.appendhere("Boop");
  30.    xdlist.reset();
  31.    cout << "\nforwards, removing\n";
  32.    while (xdlist.getnext(x))
  33. cout << "'" << (char*)x << "'\n";
  34.    cout << "\nbackwards\n";
  35.    while (xdlist.getprev(x))
  36. cout << "'" << (char*)x << "'\n";
  37.    return 0;
  38.  
  39.